-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for xyz.amorgan.blurhash in ImageContent #700
base: dev
Are you sure you want to change the base?
Add support for xyz.amorgan.blurhash in ImageContent #700
Conversation
I'd be happy to see the blurhash generation code in the library too - would you mind moving it over here from the NeoChat MR? :) |
Sure can! |
0ea5d48
to
d7f2d33
Compare
Okay the blurhash implementation has been moved here, will update the NeoChat MR accordingly |
b887bac
to
7a4ddda
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for waiting; overall LGTM save for the tests
This adds an optional key to ImageContent, for displaying a blurhash on the client before an image is loaded.
d90d364
to
b800ffb
Compare
So every client that wants to implement blurhashes doesn't have to copy this file over and over.
b800ffb
to
8bc55f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM but I have a question regarding the protected
piece. I actually thought it would be merely two functions in the interface but you seem to intend something more, apparently?
|
||
#include "blurhash.h" | ||
|
||
#include <QColorSpace> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include <QColorSpace> | |
#include <QtGui/QColorSpace> |
|
||
#include "quotient_export.h" | ||
|
||
#include <QImage> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include <QImage> | |
#include <QtGui/QImage> |
*/ | ||
static QUOTIENT_API QString encode(const QImage &image, int componentsX = 4, int componentsY = 4); | ||
|
||
protected: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protected
implies inheriting from a class - do you expect that clients should derive from this class and somehow use its static internals?
static QUOTIENT_API QString encode(const QImage &image, int componentsX = 4, int componentsY = 4); | ||
|
||
protected: | ||
struct Components { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not alias QPoint
or std::pair
?
This adds an optional key to ImageContent, for displaying a blurhash on the client before an image is loaded.
Example consumer in Neochat: https://invent.kde.org/network/neochat/-/merge_requests/1151